<?php
//框架内置的配置项 -- 适用所有应用所有环境
return [
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],
    'bootstrap' => [ //引导组件
        'log'
    ],
    'modules' => [],
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'language' => 'en-US', //默认语言
    'components' => [ //组件
        'cache' => [ //缓存
            'class' => 'yii\caching\FileCache',
        ],
        'mailer' => [ //邮件
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure a transport
            // for the mailer to send real emails.
            'useFileTransport' => true,
        ],
        'log' => [ //日志
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'urlManager' => [ //路由
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
         ],
        'i18n' => [ //多语言配置
            'translations' => [
                'error' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    //Yii的多语言设计不好的地方，key使用默认语言，只有发现非默认语言才会转换，所以这里设计一个不存在的语言
                    'sourceLanguage' => 'no_exist',
                    'basePath' => '@common/messages',
                ],
            ],
        ],
    ],
];
